<?php
namespace PsiFramework\Classes\Util\UI;

import("Classes.Util.Log.Logger");

use \PsiFramework\Classes\Util\Log\Logger;
use \PsiFramework\Classes\Util\UI\TemplateManager;

/**
 * PsiFramework
 * Php Simple Framework
 *
 * @author Rémi San
 * @version beta
 */

/**
 * The Module class describes a Module
 *
 * @package Model
 */
class Module
{

    protected /*string*/ $_name ;
    protected /*string*/ $_template ;

    protected /*Logger*/ $_logger;

    /**
     *
     * @param string $name
     * @param Template $template
     */
    public function __construct(
        /*string*/ $name=null,
        /*string*/ $template=null
    )
    {
        $this->_name = $name ;
        $this->_template = $template ;

        $this->_logger = new Logger("Plugin");
    }

    public function getName()
    {
        return $this->_name ;
    }

    public function getTemplate()
    {
        return $this->_template ;
    }

    public function addModule(Response $response, /*boolean*/ $ajaxCall=false)
    {
        TemplateManager::getInstance()->
            addTemplate($this->_template, $response, $this->_name, $ajaxCall);
    }

}
